﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data.Odbc;

namespace SqlBackUp
{
    class KetNoi
    {
        OdbcConnection  conn = new OdbcConnection();
        public OdbcConnection ThietlapketNoi(string ServerName, string DataBaseName, string serName, string Secret)
        {
            try
            {
                conn.ConnectionString = "Driver={SQL Server};Server=" + ServerName + ";DataBase=" + DataBaseName + ";Uid=" + serName + ";Pwd=" + Secret + ";";
                conn.Open();
                return conn;
            }
            catch { return null; };
        }
        public void HuyKetNoi()
        {
            conn.Close();
        }
    }
}